let realname = "zhangsan";
let age = 12;
let data = {
  realname,
  age,
  myFun() {
    console.log(this.realname);
  }
}

// 函数调用
data.myFun();